package com.tools.cleanmaster.controller;

import java.util.ArrayList;

/**
 * Created by lianzhan on 16/2/22.
 */
public class TargetFolderParam {
    protected String mStrPath;
    protected int mScanLevel;
    protected boolean mIsRootDir = false;
    protected ArrayList<String> mIgnoreDirsArrayList = new ArrayList<String>();
    protected int mFileLimit = DEF_FILE_LIMIT;
    protected int mFolderLimit = DEF_FOLDER_LIMIT;

    static private final int DEF_SCAN_LEVEL = 1;
    static private final int DEF_FILE_LIMIT = 30;// 超过30个文件扫不到APK,LOG,TMP, 就不扫了
    static private final int DEF_FOLDER_LIMIT = 15;// 过过15个文件夹是空的就不扫了

    public TargetFolderParam(String strPath) {
        this.mStrPath = strPath;
        this.mScanLevel = DEF_SCAN_LEVEL;
    }

    private TargetFolderParam() {
    }

    public TargetFolderParam(String strPath, int nScanLevel) {
        this.mStrPath = strPath;
        this.mScanLevel = nScanLevel;
    }

    public TargetFolderParam(String strPath, int nScanLevel,
                              int nFileLimit, int nFolderLimit) {
        this.mStrPath = strPath;
        this.mScanLevel = nScanLevel;
        this.mFileLimit = nFileLimit;
        this.mFolderLimit = nFolderLimit;
    }

    public void addIgnoreDir(String ignore) {
        mIgnoreDirsArrayList.add(ignore);
    }

    public TargetFolderParam copy() {
        TargetFolderParam copy = new TargetFolderParam();
        copy.mStrPath = this.mStrPath;
        copy.mScanLevel = this.mScanLevel;
        copy.mFileLimit = this.mFileLimit;
        copy.mFolderLimit = this.mFolderLimit;
        return copy;
    }

    public void setIsRootDir(boolean is) {
        mIsRootDir = is;
    }
}
